#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include "Parser.h"
#include "Executor.h"


class Shell{
    public:
        //Constructor
        Shell(char* en[]);

        int runShell();
        void processInput(Parser p, Executor exe, std::list<struct threadInfo*> *executedProcs, char * cmdStr);

        //For loop operations
        bool loopMode() { return forLoopMode;}
        std::vector<std::string> getLoopCommands() {return forLoopCommands;}
        void resetMode();
        int getFirstValue() {return firstValue;}
        int getLastValue() {return lastValue;}

    private:
        char** envr;
        void processForLoop(std::string input);

        bool forLoopMode;
        std::string varName;
        int firstValue;
        int lastValue;
        std::vector<std::string> forLoopCommands;

};
